<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var inherit = (function () {
            var Buffer = function () { }
            return function (Origin, Target) {
                Buffer.prototype = Origin.prototype;
                Target.prototype = new Buffer();
                Target.prototype.constructor = Target;
                Target.prototype.super_class = Origin;
            }
        }())

        var initProgrammer = (function () {
            var Programmer = function () { }
            Programmer.prototype = {
                name: "程序员",
                tool: "计算机",
                workTime: "10小时",
                say: function () {
                    console.log("我是一个" + this.name + "我的上班工具是：" + this.tool + "我的工作时间是" + this.workTime
                        + "我的工作方向是" + this.lang
                    )
                }
            }
            function js() { }
            function java() { }
            inherit(Programmer, js)
            inherit(Programmer, java)
            js.prototype.lang = "javaScript"
            java.prototype.lang = "java"
            return { js: js, java: java }
        }())

        var web = new initProgrammer.js()
        var back = new initProgrammer.java()
        web.say();
        back.say();
        console.log(web)
        console.log(back)
    </script>
</body>

</html>